import Vue from 'vue'
import Router from 'vue-router'

const Home = () => import ('@/pages/home/home');
const AccountManagement = () => import ('@/pages/home/followmanagement/accountmanagement')
const NewAccount = () => import  ('@/pages/home/followmanagement/newaccount')
const EditAccount = () => import ('@/pages/home/followmanagement/editaccount')
const ReadingManagement = () => import ('@/pages/home/readingmanagement/readingmanagement')
const ReadingNewadd = () => import('@/pages/home/readingmanagement/readingnewadd')
const ReadingCheckout = () => import ('@/pages/home/readingmanagement/readingcheckout')
const ReadingEdit = () => import ('@/pages/home/readingmanagement/readingedit')
const TeachList = () => import ('@/pages/home/teachermanagement/teachList')
const TeacherCheck = () => import ('@/pages/home/teachermanagement/teachercheck')
const TeacherAdd = () => import ('@/pages/home/teachermanagement/teacheradd')
const TeacherEdit = () => import ('@/pages/home/teachermanagement/teacheredit')
const UserInfo = () => import ('@/pages/home/usermanagement/userinfo')
const UserList = () => import ('@/pages/home/usermanagement/userlist')
const ClockList = () => import ('@/pages/home/clockin/clocklist')
const ClockInfo = () => import ('@/pages/home/clockin/clockinfo')
const ChangePassword = () => import ('@/pages/home/changePassword/changepassword')
const RoleManagement = () => import ('@/pages/home/rolemanagement/rolemanagement')
const EditNewRole = () => import ('@/pages/home/rolemanagement/editNewRole')
const AddNewRole = () => import ('@/pages/home/rolemanagement/addNewRole')
const ModuleManagement = () => import ('@/pages/home/modulemanagement/modulemanagement')
const ModuleAdd = () => import('@/pages/home/modulemanagement/moduleadd')
const ModuleEdit = () => import ('@/pages/home/modulemanagement/moduleedit')
const Login = () => import ('@/pages/login/login')


Vue.use(Router);

export default new Router({
  scrollBehavior: () => ({y: 0}),
  routes: [
    {
      path: '/login',
      component: Login
    },
    {
      path: '/',
      component: Home,
      children: [
        {
          path: '1',
          name: 'ReadingManagement',
          component: ReadingManagement

        },
        {
          path: '1-1',
          name: 'ReadingNewadd',
          component: ReadingNewadd
        },
        {
          path: '1-3',
          name: 'ReadingEdit',
          component: ReadingEdit
        },
        {
          path: '2-1',
          name: 'TeachList',
          component: TeachList
        },
        {
          path: '2-2',
          name: 'TeacherCheck',
          component: TeacherCheck
        },
        {
          path: '2-3',
          name: 'TeacherAdd',
          component: TeacherAdd
        },
        {
          path: '2-4',
          name: 'TeacherEdit',
          component: TeacherEdit
        },
        {
          path: '3-1',
          name: 'UserList',
          component: UserList
        },
        {
          path: '3-2',
          name: 'UserInfo',
          component: UserInfo
        },
        {
          path: '4-1',
          name: 'ClockList',
          component: ClockList
        },
        {
          path: '4-2',
          name: 'ClockInfo',
          component: ClockInfo
        },
        {
          path: '1-2',
          name: 'ReadingCheckout',
          component: ReadingCheckout
        },
        {
          path: '5-1',
          name: 'AccountManagement',
          component: AccountManagement
        },
        {
          path: '5-2',
          name: 'ChangePassword',
          component: ChangePassword
        },
        {
          path: '5-3',
          name: 'RoleManagement',
          component: RoleManagement
        },
        {
          path: '5-4',
          name: 'ModuleManagement',
          component: ModuleManagement
        },
        {
          path: '5-4-1',
          name: 'ModuleEdit',
          component: ModuleEdit
        },
        {
          path: '5-4-2',
          name: 'ModuleAdd',
          component: ModuleAdd
        },
        {
          path: '5-5',
          name: 'AddNewRole',
          component: AddNewRole
        },
        {
          path: '5-8',
          name: 'EditNewRole',
          component: EditNewRole
        },
        {
          path: '5-1-1',
          name: 'NewAccount',
          component: NewAccount
        },
        {
          path: '5-1-2',
          name: 'EditAccount',
          component: EditAccount
        }
      ]
    }
  ]
})
